package com.ssm.springboot.ScheduledTest;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Old Zhang
 * @Deseription 测试定时任务
 * @create 2018/8/16 12:17
 **/
@Component
public class ScheduledTasks {


    /**
     * @Description
     * @author canger
     * @date 2018/8/16 12:28
     * @return java.lang.String
     **/
//    @Scheduled(fixedRate = 5000)
    @Scheduled(fixedDelay = 5000)
    public void testScheduled(){
        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
        System.out.println("北京时间"+format.format(new Date()));
    }
}
